# https://pyecharts.org/#/zh-cn/

from pyecharts import options as opts
from pyecharts.charts import Pie
from pyecharts.faker import Faker

lst=[['华为', 100], ['苹果', 203], ['oppo', 20], ['小米', 300]]

c = (
    Pie()
    .add(
        "phone",
        # [list(z) for z in zip(Faker.choose(), Faker.values())],
        lst,
        center=["35%", "50%"],
    )
    .set_global_opts(
        title_opts=opts.TitleOpts(title="phone sales"),
        legend_opts=opts.LegendOpts(pos_left="15%"),
    )
    .set_series_opts(label_opts=opts.LabelOpts(formatter="{b}: {c}"))
    .render("pie_position.html")
)
